<?php

namespace app\common\model;

use think\Model;

class Article extends Model
{
    // 表名
    protected $name = 'article';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';

    public $statusList = ['normal' => '正常', 'hidden' => '隐藏'];

    // 追加属性
    protected $append = [

    ];


    public function category()
    {
        return $this->belongsTo('Category', 'cid')->setEagerlyType(0);
    }


}
